Methods and systems for load balancing based on data shard leader

ABSTRACT

Disclosed are systems, methods, and computer-readable storage media for load balance resources amongst computing nodes. Various embodiments of the present technology can be used to, prior to assigning a first data shard included in a first cluster of data shards as a leader of the first cluster of data shards, determine whether a first computing node storing the first data shard also stores a second data shard designated as a leader of a second cluster of data shards, yielding a determination, and when the determination indicates that the first computing node stores the second data shard designated as the leader of the second cluster of data shards, designate the first data shard as non-electable to be the leader of the first cluster of data shards and electing an alternate data shard included in the first cluster of data shards as the leader of the first cluster of data shards.

TECHNICAL FIELD

The present disclosure relates generally to computing nodes, and more specifically to load balancing resourced based on data shard leader.

BACKGROUND

Modern computing networks can include multiple computing devices that work together as a coherent group. For example, multiple computing devices can work together to provide a fault-tolerant service in the event that one of the computing devices has an error or otherwise becomes unavailable. One example is the use of replicated state machines to provide a fault-tolerant service. In this approach, multiple state machines in a cluster maintain replicated data shards to provide continuous service in the even that one or more of the state machines has an error or otherwise becomes unavailable. A computing node can include a switch (e.g., a router) or an end point (e.g., a host device, server, etc.).

A consensus algorithm, such as the Raft consensus algorithm, can be used to manage replicating data amongst the data shards stored by each computing node. A consensus algorithm involves multiple data shards communicating to agree on values to make a decision. For example, in the context of replicated state machines, each data shard in the cluster can maintain a log of commands that the state machine takes as input and the consensus algorithm can be used to replicate the log amongst the data shards in the cluster.

A consensus algorithm can require that one data shard from each cluster be designated as the leader of the cluster. The leader of the cluster can be in charge of organizing data replication across the data shards in the cluster. For example, using the raft algorithm, log entries can flow from the leader to the other data shards, thereby causing higher resource consumption by the computing node storing the leader. A computing node can store multiple data shard and each data shard can be a member of a different cluster. As a result, a computing node can store multiple shards that are designated as the leader of their respective cluster. This can result in higher resource consumption by the computing node and cause performance issues.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to describe the manner in which the above-recited features and other advantages of the disclosure can be obtained, a more particular description of the principles briefly described above will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. Understanding that these drawings depict only exemplary embodiments of the disclosure and are not therefore to be considered to be limiting its scope, the principles herein are described and explained with additional specificity and detail through the use of the accompanying drawings in which:

FIG. 1 illustrates an example network device according to some aspects of the subject technology;

FIGS. 2A and 2B illustrate an example system embodiments according to some aspects of the subject technology;

FIG. 3 illustrates a schematic block diagram of an example architecture for a network fabric;

FIG. 4 illustrates an example overlay network;

FIG. 5 illustrates an exemplary system embodiment of a controller configured to load balance resources amongst computing nodes storing data shards; and

FIG. 6 illustrates an example method of balancing resources amongst computing nodes based on shard cluster leader.

DESCRIPTION OF EXAMPLE EMBODIMENTS

The detailed description set forth below is intended as a description of various configurations of the subject technology and is not intended to represent the only configurations in which the subject technology can be practiced. The appended drawings are incorporated herein and constitute a part of the detailed description. The detailed description includes specific details for the purpose of providing a more thorough understanding of the subject technology. However, it will be clear and apparent that the subject technology is not limited to the specific details set forth herein and may be practiced without these details. In some instances, structures and components are shown in block diagram form in order to avoid obscuring the concepts of the subject technology.

Overview:

Disclosed are systems, methods, and computer-readable storage media for load balance resources amongst computing nodes. Various embodiments of the present technology can be used to, prior to assigning a first data shard included in a first cluster of data shards as a leader of the first cluster of data shards, determine whether a first computing node storing the first data shard also stores a second data shard designated as a leader of a second cluster of data shards, yielding a determination, and when the determination indicates that the first computing node stores the second data shard designated as the leader of the second cluster of data shards, designate the first data shard as non-electable to be the leader of the first cluster of data shards and electing an alternate data shard included in the first cluster of data shards as the leader of the first cluster of data shards.

Detailed Description:

Disclosed are systems and methods for load balance resources amongst a cluster of computing nodes. A brief introductory description of exemplary systems and networks, as illustrated in FIGS. 1 through 4, is disclosed herein, followed by a discussion of load balancing resources amongst a cluster of computing nodes. The disclosure now turns to FIG. 1.

A computer network is a geographically distributed collection of nodes interconnected by communication links and segments for transporting data between endpoints, such as personal computers and workstations. Many types of networks are available, with the types ranging from local area networks (LANs) and wide area networks (WANs) to overlay and software-defined networks, such as virtual extensible local area networks (VXLANs).

LANs typically connect nodes over dedicated private communications links located in the same general physical location, such as a building or campus. WANs, on the other hand, typically connect geographically dispersed nodes over long-distance communications links, such as common carrier telephone lines, optical lightpaths, synchronous optical networks (SONET), or synchronous digital hierarchy (SDH) links. LANs and WANs can include layer 2 (L2) and/or layer 3 (L3) networks and devices.

The Internet is an example of a WAN that connects disparate networks throughout the world, providing global communication between nodes on various networks. The nodes typically communicate over the network by exchanging discrete frames or packets of data according to predefined protocols, such as the Transmission Control Protocol/Internet Protocol (TCP/IP). In this context, a protocol can refer to a set of rules defining how the nodes interact with each other. Computer networks may be further interconnected by an intermediate network node, such as a router, to extend the effective “size” of each network.

Overlay networks generally allow virtual networks to be created and layered over a physical network infrastructure. Overlay network protocols, such as Virtual Extensible LAN (VXLAN), Network Virtualization using Generic Routing Encapsulation (NVGRE), Network Virtualization Overlays (NVO3), and Stateless Transport Tunneling (STT), provide a traffic encapsulation scheme which allows network traffic to be carried across L2 and L3 networks over a logical tunnel. Such logical tunnels can be originated and terminated through virtual tunnel end points (VTEPs).

Moreover, overlay networks can include virtual segments, such as VXLAN segments in a VXLAN overlay network, which can include virtual L2 and/or L3 overlay networks over which virtual machines (VMs) communicate. The virtual segments can be identified through a virtual network identifier (VNI), such as a VXLAN network identifier, which can specifically identify an associated virtual segment or domain.

Network virtualization allows hardware and software resources to be combined in a virtual network. For example, network virtualization can allow multiple numbers of VMs to be attached to the physical network via respective virtual LANs (VLANs). The VMs can be grouped according to their respective VLAN, and can communicate with other VMs as well as other devices on the internal or external network.

Network segments, such as physical or virtual segments; networks; devices; ports; physical or logical links; and/or traffic in general can be grouped into a bridge or flood domain. A bridge domain or flood domain can represent a broadcast domain, such as an L2 broadcast domain. A bridge domain or flood domain can include a single subnet, but can also include multiple subnets. Moreover, a bridge domain can be associated with a bridge domain interface on a network device, such as a switch. A bridge domain interface can be a logical interface which supports traffic between an L2 bridged network and an L3 routed network. In addition, a bridge domain interface can support internet protocol (IP) termination, VPN termination, address resolution handling, MAC addressing, etc. Both bridge domains and bridge domain interfaces can be identified by a same index or identifier.

Furthermore, endpoint groups (EPGs) can be used in a network for mapping applications to the network. In particular, EPGs can use a grouping of application endpoints in a network to apply connectivity and policy to the group of applications. EPGs can act as a container for buckets or collections of applications, or application components, and tiers for implementing forwarding and policy logic. EPGs also allow separation of network policy, security, and forwarding from addressing by instead using logical application boundaries.

Cloud computing can also be provided in one or more networks to provide computing services using shared resources. Cloud computing can generally include Internet-based computing in which computing resources are dynamically provisioned and allocated to client or user computers or other devices on-demand, from a collection of resources available via the network (e.g., “the cloud”). Cloud computing resources, for example, can include any type of resource, such as computing, storage, and network devices, virtual machines (VMs), etc. For instance, resources may include service devices (firewalls, deep packet inspectors, traffic monitors, load balancers, etc.), compute/processing devices (servers, CPU's, memory, brute force processing capability), storage devices (e.g., network attached storages, storage area network devices), etc. In addition, such resources may be used to support virtual networks, virtual machines (VM), databases, applications (Apps), etc.

Cloud computing resources may include a “private cloud,” a “public cloud,” and/or a “hybrid cloud.” A “hybrid cloud” can be a cloud infrastructure composed of two or more clouds that inter-operate or federate through technology. In essence, a hybrid cloud is an interaction between private and public clouds where a private cloud joins a public cloud and utilizes public cloud resources in a secure and scalable manner. Cloud computing resources can also be provisioned via virtual networks in an overlay network, such as a VXLAN.

FIG. 1 illustrates an exemplary network device 110 suitable for implementing the present technology. Network device 110 includes a master central processing unit (CPU) 162, interfaces 168, and a bus 115 (e.g., a PCI bus). When acting under the control of appropriate software or firmware, the CPU 162 is responsible for executing packet management, error detection, and/or routing functions, such policy enforcement, for example. The CPU 162 preferably accomplishes all these functions under the control of software including an operating system and any appropriate applications software. CPU 162 may include one or more processors 163 such as a processor from the Motorola family of microprocessors or the MIPS family of microprocessors. In an alternative embodiment, processor 163 is specially designed hardware for controlling the operations of router 110. In a specific embodiment, a memory 161 (such as non-volatile RAM and/or ROM) also forms part of CPU 162. However, there are many different ways in which memory could be coupled to the system.

The interfaces 168 are typically provided as interface cards (sometimes referred to as “line cards”). Generally, they control the sending and receiving of data packets over the network and sometimes support other peripherals used with the network device 110. Among the interfaces that may be provided are Ethernet interfaces, frame relay interfaces, cable interfaces, DSL interfaces, token ring interfaces, and the like. In addition, various very high-speed interfaces may be provided such as fast token ring interfaces, wireless interfaces, Ethernet interfaces, Gigabit Ethernet interfaces, ATM interfaces, HSSI interfaces, POS interfaces, FDDI interfaces and the like. Generally, these interfaces may include ports appropriate for communication with the appropriate media. In some cases, they may also include an independent processor and, in some instances, volatile RAM. The independent processors may control such communications intensive tasks as packet switching, media control, and management. By providing separate processors for the communications intensive tasks, these interfaces allow the master microprocessor 162 to efficiently perform routing computations, network diagnostics, security functions, etc.

Although the system shown in FIG. 1 is one specific network device of the present technology, it is by no means the only network device architecture on which the present technology can be implemented. For example, an architecture having a single processor that handles communications as well as routing computations, etc. is often used. Further, other types of interfaces and media could also be used with the router.

Regardless of the network device's configuration, it may employ one or more memories or memory modules (including memory 161) configured to store program instructions for the general-purpose network operations and mechanisms for roaming, route optimization and routing functions described herein. The program instructions may control the operation of an operating system and/or one or more applications, for example. The memory or memories may also be configured to store tables such as mobility binding, registration, and association tables, etc.

FIG. 2A, and FIG. 2B illustrate exemplary possible system embodiments. The more appropriate embodiment will be apparent to those of ordinary skill in the art when practicing the present technology. Persons of ordinary skill in the art will also readily appreciate that other system embodiments are possible.

FIG. 2A illustrates a conventional system bus computing system architecture 200 wherein the components of the system are in electrical communication with each other using a bus 205. Exemplary system 200 includes a processing unit (CPU or processor) 210 and a system bus 205 that couples various system components including the system memory 215, such as read only memory (ROM) 220 and random access memory (RAM) 225, to the processor 210. The system 200 can include a cache of high-speed memory connected directly with, in close proximity to, or integrated as part of the processor 210. The system 200 can copy data from the memory 215 and/or the storage device 230 to the cache 212 for quick access by the processor 210. In this way, the cache can provide a performance boost that avoids processor 210 delays while waiting for data. These and other modules can control or be configured to control the processor 210 to perform various actions. Other system memory 215 may be available for use as well. The memory 215 can include multiple different types of memory with different performance characteristics. The processor 210 can include any general purpose processor and a hardware module or software module, such as module 1 232, module 2 234, and module 3 236 stored in storage device 230, configured to control the processor 210 as well as a special-purpose processor where software instructions are incorporated into the actual processor design. The processor 210 may essentially be a completely self-contained computing system, containing multiple cores or processors, a bus, memory controller, cache, etc. A multi-core processor may be symmetric or asymmetric.

To enable user interaction with the computing device 200, an input device 245 can represent any number of input mechanisms, such as a microphone for speech, a touch-sensitive screen for gesture or graphical input, keyboard, mouse, motion input, speech and so forth. An output device 235 can also be one or more of a number of output mechanisms known to those of skill in the art. In some instances, multimodal systems can enable a user to provide multiple types of input to communicate with the computing device 200. The communications interface 240 can generally govern and manage the user input and system output. There is no restriction on operating on any particular hardware arrangement and therefore the basic features here may easily be substituted for improved hardware or firmware arrangements as they are developed.

Storage device 230 is a non-volatile memory and can be a hard disk or other types of computer readable media which can store data that are accessible by a computer, such as magnetic cassettes, flash memory cards, solid state memory devices, digital versatile disks, cartridges, random access memories (RAMs) 225, read only memory (ROM) 220, and hybrids thereof.

The storage device 230 can include software modules 232, 234, 236 for controlling the processor 210. Other hardware or software modules are contemplated. The storage device 230 can be connected to the system bus 205. In one aspect, a hardware module that performs a particular function can include the software component stored in a computer-readable medium in connection with the necessary hardware components, such as the processor 210, bus 205, display 235, and so forth, to carry out the function.

FIG. 2B illustrates a computer system 250 having a chipset architecture that can be used in executing the described method and generating and displaying a graphical user interface (GUI). Computer system 250 is an example of computer hardware, software, and firmware that can be used to implement the disclosed technology. System 250 can include a processor 255, representative of any number of physically and/or logically distinct resources capable of executing software, firmware, and hardware configured to perform identified computations. Processor 255 can communicate with a chipset 260 that can control input to and output from processor 255. In this example, chipset 260 outputs information to output 265, such as a display, and can read and write information to storage device 270, which can include magnetic media, and solid state media, for example. Chipset 260 can also read data from and write data to RAM 275. A bridge 280 for interfacing with a variety of user interface components 285 can be provided for interfacing with chipset 260. Such user interface components 285 can include a keyboard, a microphone, touch detection and processing circuitry, a pointing device, such as a mouse, and so on. In general, inputs to system 250 can come from any of a variety of sources, machine generated and/or human generated.

Chipset 260 can also interface with one or more communication interfaces 290 that can have different physical interfaces. Such communication interfaces can include interfaces for wired and wireless local area networks, for broadband wireless networks, as well as personal area networks. Some applications of the methods for generating, displaying, and using the GUI disclosed herein can include receiving ordered datasets over the physical interface or be generated by the machine itself by processor 255 analyzing data stored in storage 270 or 275. Further, the machine can receive inputs from a user via user interface components 285 and execute appropriate functions, such as browsing functions by interpreting these inputs using processor 255.

It can be appreciated that exemplary systems 200 and 250 can have more than one processor 210 or be part of a group or cluster of computing devices networked together to provide greater processing capability.

FIG. 3 illustrates a schematic block diagram of an example architecture 300 for a network fabric 312. The network fabric 312 can include spine switches 302 _(A), 302 _(B), . . . , 302 _(N) (collectively “302”) connected to leaf switches 304 _(A), 304 _(B), 304 _(C) . . . 304 _(N) (collectively “304”) in the network fabric 312.

Spine switches 302 can be L3 switches in the fabric 312. However, in some cases, the spine switches 302 can also, or otherwise, perform L2 functionalities. Further, the spine switches 302 can support various capabilities, such as 40 or 10 Gbps Ethernet speeds. To this end, the spine switches 302 can include one or more 40 Gigabit Ethernet ports. Each port can also be split to support other speeds. For example, a 40 Gigabit Ethernet port can be split into four 10 Gigabit Ethernet ports.

In some embodiments, one or more of the spine switches 302 can be configured to host a proxy function that performs a lookup of the endpoint address identifier to locator mapping in a mapping database on behalf of leaf switches 304 that do not have such mapping. The proxy function can do this by parsing through the packet to the encapsulated, tenant packet to get to the destination locator address of the tenant. The spine switches 302 can then perform a lookup of their local mapping database to determine the correct locator address of the packet and forward the packet to the locator address without changing certain fields in the header of the packet.

When a packet is received at a spine switch 302 _(i), the spine switch 302 _(i) can first check if the destination locator address is a proxy address. If so, the spine switch 302 _(i) can perform the proxy function as previously mentioned. If not, the spine switch 302 _(i) can look up the locator in its forwarding table and forward the packet accordingly.

Spine switches 302 connect to leaf switches 304 in the fabric 312. Leaf switches 304 can include access ports (or non-fabric ports) and fabric ports. Fabric ports can provide uplinks to the spine switches 302, while access ports can provide connectivity for devices, hosts, endpoints, VMs, or external networks to the fabric 312.

Leaf switches 304 can reside at the edge of the fabric 312, and can thus represent the physical network edge. In some cases, the leaf switches 304 can be top-of-rack (“ToR”) switches configured according to a ToR architecture. In other cases, the leaf switches 304 can be aggregation switches in any particular topology, such as end-of-row (EoR) or middle-of-row (MoR) topologies. The leaf switches 304 can also represent aggregation switches, for example.

The leaf switches 304 can be responsible for routing and/or bridging the tenant packets and applying network policies. In some cases, a leaf switch can perform one or more additional functions, such as implementing a mapping cache, sending packets to the proxy function when there is a miss in the cache, encapsulate packets, enforce ingress or egress policies, etc.

Moreover, the leaf switches 304 can contain virtual switching functionalities, such as a virtual tunnel endpoint (VTEP) function as explained below in the discussion of VTEP 408 in FIG. 4. To this end, leaf switches 304 can connect the fabric 312 to an overlay network, such as overlay network 400 illustrated in FIG. 4.

Network connectivity in the fabric 312 can flow through the leaf switches 304. Here, the leaf switches 304 can provide servers, resources, endpoints, external networks, or VMs access to the fabric 312, and can connect the leaf switches 304 to each other. In some cases, the leaf switches 304 can connect EPGs to the fabric 312 and/or any external networks. Each EPG can connect to the fabric 312 via one of the leaf switches 304, for example.

Endpoints 310A-E (collectively “310”) can connect to the fabric 312 via leaf switches 304. For example, endpoints 310A and 310B can connect directly to leaf switch 304A, which can connect endpoints 310A and 310B to the fabric 312 and/or any other one of the leaf switches 304. Similarly, endpoint 310E can connect directly to leaf switch 304C, which can connect endpoint 310E to the fabric 312 and/or any other of the leaf switches 304. On the other hand, endpoints 310C and 310D can connect to leaf switch 304B via L2 network 306. Similarly, the wide area network (WAN) can connect to the leaf switches 304C or 304D via L3 network 308.

Endpoints 310 can include any communication device, such as a computer, a server, a switch, a router, etc. In some cases, the endpoints 310 can include a server, hypervisor, or switch configured with a VTEP functionality which connects an overlay network, such as overlay network 400 below, with the fabric 312. For example, in some cases, the endpoints 310 can represent one or more of the VTEPs 408A-D illustrated in FIG. 4. Here, the VTEPs 408A-D can connect to the fabric 312 via the leaf switches 304. The overlay network can host physical devices, such as servers, applications, EPGs, virtual segments, virtual workloads, etc. In addition, the endpoints 310 can host virtual workload(s), clusters, and applications or services, which can connect with the fabric 312 or any other device or network, including an external network. For example, one or more endpoints 310 can host, or connect to, a cluster of load balancers or an EPG of various applications.

Although the fabric 312 is illustrated and described herein as an example leaf-spine architecture, one of ordinary skill in the art will readily recognize that the subject technology can be implemented based on any network fabric, including any data center or cloud network fabric. Indeed, other architectures, designs, infrastructures, and variations are contemplated herein.

FIG. 4 illustrates an exemplary overlay network 400. Overlay network 400 uses an overlay protocol, such as VXLAN, VGRE, VO3, or STT, to encapsulate traffic in L2 and/or L3 packets which can cross overlay L3 boundaries in the network. As illustrated in FIG. 4, overlay network 400 can include hosts 406A-D interconnected via network 402.

Network 402 can include a packet network, such as an IP network, for example. Moreover, network 402 can connect the overlay network 400 with the fabric 312 in FIG. 3. For example, VTEPs 408A-D can connect with the leaf switches 304 in the fabric 312 via network 402.

Hosts 406A-D include virtual tunnel end points (VTEP) 408A-D, which can be virtual nodes or switches configured to encapsulate and de-encapsulate data traffic according to a specific overlay protocol of the network 400, for the various virtual network identifiers (VNIDs) 410A-I. Moreover, hosts 406A-D can include servers containing a VTEP functionality, hypervisors, and physical switches, such as L3 switches, configured with a VTEP functionality. For example, hosts 406A and 406B can be physical switches configured to run VTEPs 408A-B. Here, hosts 406A and 406B can be connected to servers 404A-D, which, in some cases, can include virtual workloads through VMs loaded on the servers, for example.

In some embodiments, network 400 can be a VXLAN network, and VTEPs 408A-D can be VXLAN tunnel end points (VTEP). However, as one of ordinary skill in the art will readily recognize, network 400 can represent any type of overlay or software-defined network, such as NVGRE, STT, or even overlay technologies yet to be invented.

The VNIDs can represent the segregated virtual networks in overlay network 400. Each of the overlay tunnels (VTEPs 408A-D) can include one or more VNIDs. For example, VTEP 408A can include VNIDs 1 and 2, VTEP 408B can include VNIDs 1 and 2, VTEP 408C can include VNIDs 1 and 2, and VTEP 408D can include VNIDs 1-3. As one of ordinary skill in the art will readily recognize, any particular VTEP can, in other embodiments, have numerous VNIDs, including more than the 3 VNIDs illustrated in FIG. 4.

The traffic in overlay network 400 can be segregated logically according to specific VNIDs. This way, traffic intended for VNID 1 can be accessed by devices residing in VNID 1, while other devices residing in other VNIDs (e.g., VNIDs 2 and 3) can be prevented from accessing such traffic. In other words, devices or endpoints connected to specific VNIDs can communicate with other devices or endpoints connected to the same specific VNIDs, while traffic from separate VNIDs can be isolated to prevent devices or endpoints in other specific VNIDs from accessing traffic in different VNIDs.

Servers 404A-D and VMs 404E-I can connect to their respective VNID or virtual segment, and communicate with other servers or VMs residing in the same VNID or virtual segment. For example, server 404A can communicate with server 404C and VMs 404E and 404G because they all reside in the same VNID, viz., VNID 1. Similarly, server 404B can communicate with VMs 404F and 404H because they all reside in VNID 2. VMs 404E-I can host virtual workloads, which can include application workloads, resources, and services, for example. However, in some cases, servers 404A-D can similarly host virtual workloads through VMs hosted on the servers 404A-D. Moreover, each of the servers 404A-D and VMs 404E-I can represent a single server or VM, but can also represent multiple servers or VMs, such as a cluster of servers or VMs.

VTEPs 408A-D can encapsulate packets directed at the various VNIDs 1-3 in the overlay network 400 according to the specific overlay protocol implemented, such as VXLAN, so traffic can be properly transmitted to the correct VNID and recipient(s). Moreover, when a switch, router, or other network device receives a packet to be transmitted to a recipient in the overlay network 400, it can analyze a routing table, such as a lookup table, to determine where such packet needs to be transmitted so the traffic reaches the appropriate recipient. For example, if VTEP 408A receives a packet from endpoint 404B that is intended for endpoint 404H, VTEP 408A can analyze a routing table that maps the intended endpoint, endpoint 404H, to a specific switch that is configured to handle communications intended for endpoint 404H. VTEP 408A might not initially know, when it receives the packet from endpoint 404B, that such packet should be transmitted to VTEP 408D in order to reach endpoint 404H. Accordingly, by analyzing the routing table, VTEP 408A can lookup endpoint 404H, which is the intended recipient, and determine that the packet should be transmitted to VTEP 408D, as specified in the routing table based on endpoint-to-switch mappings or bindings, so the packet can be transmitted to, and received by, endpoint 404H as expected.

However, continuing with the previous example, in many instances, VTEP 408A may analyze the routing table and fail to find any bindings or mappings associated with the intended recipient, e.g., endpoint 404H. Here, the routing table may not yet have learned routing information regarding endpoint 404H. In this scenario, the VTEP 408A may likely broadcast or multicast the packet to ensure the proper switch associated with endpoint 404H can receive the packet and further route it to endpoint 404H.

In some cases, the routing table can be dynamically and continuously modified by removing unnecessary or stale entries and adding new or necessary entries, in order to maintain the routing table up-to-date, accurate, and efficient, while reducing or limiting the size of the table.

As one of ordinary skill in the art will readily recognize, the examples and technologies provided above are simply for clarity and explanation purposes, and can include many additional concepts and variations.

Depending on the desired implementation in the network 400, a variety of networking and messaging protocols may be used, including but not limited to TCP/IP, open systems interconnection (OSI), file transfer protocol (FTP), universal plug and play (UpnP), network file system (NFS), common internet file system (CIFS), AppleTalk etc. As would be appreciated by those skilled in the art, the network 400 illustrated in FIG. 4 is used for purposes of explanation, a network system may be implemented with many variations, as appropriate, in the configuration of network platform in accordance with various embodiments of the present disclosure.

Having disclosed a brief introductory description of exemplary systems and networks, the discussion now turns to load balancing resources amongst computing nodes based on data shard cluster leader. A computing node can be made up of one or more computing devices in a computing network. For example, a computing node can be made up of one or more switches, routers, end points, servers, etc., or combination thereof in the computing network. A computing node and its components can reside in any computing device in the computing network either separately or as whole unit.

A computing node can be configured to operate in conjunction with other computing nodes to provide fault-tolerant services. For example, a computing node can work in conjunction with other computing nodes to facilitate replicated state machines that provide high availability in the event that one or more of the state machines in the cluster experiences an error or otherwise becomes unavailable.

To accomplish this, a computing node can store a data shard included in a cluster of data shards, each of which maintains replicated data. The data shards can utilize a consensus algorithm, such as the Raft algorithm, to replicate data across the data shards in the cluster, resulting in each data shard in the cluster maintaining replicated data. In the event that a data shard in the cluster fails, one of the other data shards in the cluster can be used to seamlessly continue providing the services.

Each cluster of data shards can include one data shard that is designated as the leader of the cluster. The other data shards in the cluster can be designated as followers. The leader data shard can be configured to organize and/or manage data replication across the cluster. For example, the leader can manage transmitting data to the followers in the cluster for data replication. Due to this increased functionality, data usage by the leader data shard can be higher than resource usage by the follower data shards in the cluster.

Each cluster can elect one data shard to be the leader of the cluster. For example, one of the data shards can be elected at random and assigned the leader of the cluster. If the leader data shard suffers an error or is otherwise made unavailable, a different data shard from the cluster can be elected as the leader of the cluster.

A computing node can store multiple data shard, each included in a different cluster of data shards. As a result, a computing node may store multiple data shared that are assigned as the leader of their respective cluster, thereby causing increased resource usage by the computing node and potentially leading to performance issues. To alleviate this issue, resource usage can be load balanced amongst computing nodes based on cluster leader.

FIG. 5 illustrates an exemplary system embodiment of a controller 500 configured to load balance resources amongst computing nodes storing data shards. The controller 500 can be any computing node in a network. For example, the controller 500 can be a computing node storing data shards included in a cluster of data shards. Alternatively, the controller 500 can be a computing node that does not store data shards included in a cluster of data shards.

Prior to assigning an elected data shard as the leader of a cluster, the controller 500 can be configured to determine whether the computing node containing the elected data shard is storing another data shard that is already assigned as the leader of another cluster. If so, the controller 500 will not assign the elected data shard as the leader of the cluster and can elect a different data shard as the leader of the cluster.

The controller 500 can include an election module 502 configure to elect a leader data shard for a cluster of data shards. For example, the election module 502 can identify each data shard in the cluster that is a candidate to be elected as the leader of the cluster and select one of the candidate data shards as the leader. The election module 502 can select the leader in any number of ways, such as selecting by random, according to a specified order, etc.

The controller 500 can also include a balancing module 504 configured to determine whether the computing node storing an elected candidate data shard already stores another data shard that is assigned as the leader of its respective cluster. For example, after the election module 502 elects a candidate data shard to be the leader, but prior to the elected candidate data shard being assigned the leader, the balancing module 504 can determine whether the computing node storing the elected candidate data shard is already storing another data shard assigned as the leader of another cluster of data shards. If the balancing module 504 determines that the computing node storing the elected candidate data shard is not storing another data shard assigned as the leader of its respective cluster (e.g., the computing node is not storing any data shards assigned as a leader), the balancing module 504 can instruct the election module 502 to assign the elected candidate data shard as the leader of the cluster.

Alternatively, if the balancing module 504 determines that the computing node is storing another data shard designated as the leader of its respective cluster, the balancing module 504 can instruct the election module 502 to elect a different leader for the cluster. Accordingly, a computing node will not simultaneously store more than one data shard assigned as the leader of its respective cluster.

Additionally, in some embodiments, the balancing module 504 can designate a data shard as a non-electable follower for its cluster. Designating a data shard as a non-electable follower can result in the data shard not being eligible for election as the leader of its cluster in the future. For example, if the balancing module 504 determines that a computing node storing a candidate data shard elected to be the leader of its cluster is already storing another data shard assigned as leader of its respective cluster, the balancing module 504 can designate the candidate data shard as a non-electable follower.

As a result, the candidate data shard will not be included in elections to be the leader of its respective cluster. For example, when electing a leader for a cluster of data shards, the election module 502 can first check whether the data shards in the cluster are designated as a non-electable follower and only include data shards that are not designated as non-electable followers (e.g., data shares that are designated as electable followers) to be candidates for election as the leader of the cluster.

In some embodiments, a data shard designated as a non-electable follower can again be designated as an electable follower, meaning that the data shard can again become eligible for election as the leader of its cluster. For example, balancing module 504 can be configured to periodically check computing nodes containing data shards designated as non-electable followers to determine whether the computing nodes are storing a data shard assigned as the leader of a cluster. If the balancing module 504 determines that a computing node is not storing a data shard assigned as the leader of a cluster, the balancing module 504 can change the status of each non-electable follower data shared stored by the computing node to electable follower, thereby making the data shards eligible for election as a leader of their respective clusters.

In some embodiments, the balancing module 504 can be configured to calculate a resource weightage for a computing node and assign a status to the data shards stored by the computing node based on the resource weightage. A resource weightage can be a value indicating the resource usage of the computing node. The balancing module 504 can calculate the resource weightage for a computing node based on multiple factors, such as resource usage of the computing node, whether the computing node stores a data shard that is a leader of its cluster, the location of the computing node, etc.

The balancing module 504 can use the resource weightage for a computing node to assign a status to the data shards stored by the computing node. For example, the balancing module 504 can assign a status of non-electable follower to the data shards stored by a computing node that has a resource weightage that meets or exceeds a threshold resource usage value. Accordingly, the balancing module 504 can assign a status of electable follower to data shards stored by a computing node that has a resource usage below the threshold value.

As another example, the balancing module 504 can assign a status on non-electable follower to data shards stored by computing nodes in the cluster with the highest resource weightage. For example, the balancing module 504 can assign a status of non-electable follower to the data shares stored by computing nodes with the top five resource weightage or a resource weightage that is in the top five or ten percent amongst the computing nodes in the cluster. Likewise, the balancing module 504 can assign a status of electable follower to data shards stored by computing nodes that are not in the top for resource weightage.

The balancing module 504 can be configured to recalculate the resource weightage for the computing nodes according to a specified schedule, such as at specified time increments. Further, the balancing module 504 can be configured to recalculate the resource weightage in response to the occurrence of specified events, such as election of a new leader, an error occurring at a computing node/data shard, etc.

In addition to being used by the balancing module 504 to assign statuses to the data shards stored by the computing nodes, the resource weightage for a computing node can also be used by the election module 502 to elect a leader for a cluster of data shards. For example, the election module 502 can elect the candidate shard stored by the computing node with the lowest resource weightage to be the leader of its cluster. As another example, the election module 502 can elect a candidate data shard from a set of candidate data shards stored by computing nodes with the lowest resource weightage, such as from the two or three computing nodes with the lowest resource weightage, to be the leader of the cluster. As another example the election module 502 can elect a candidate data shard from a set of candidate data shard stored by computing nodes with a resource weightage that is below a specified threshold resource weightage, to be the leader of the cluster.

Having disclosed some basic system components and concepts, the disclosure now turns to the example method shown in FIG. 6. For the sake of clarity, the method is described in terms of the systems as shown in FIGS. 1-5, configured to practice the method. The steps outlined herein are example and can be implemented in any combination thereof, including combinations that exclude, add, or modify certain steps.

FIG. 6 illustrates an example method of balancing resources amongst computing nodes based on a cluster leader. As shown, the method begins at block 602 where a controller 500 elects a candidate data shard to be a leader of a cluster of data shards. The controller 500 can elect the candidate data shard by identifying a set of candidate data shards in the cluster that are designated as electable followers. The controller 500 can then elect one of the candidate data shards as the leader, for example by random, a specified order, based on resource weightage, etc.

At block 604, the controller 500 can determine whether the computing node storing the elected candidate data shard is storing another data shard that is designated as a leader of another cluster of data shards. If at block 604 the controller 500 determines that the computing node is not storing another data shard that is the leader of another cluster, the method continues to block 608 where the controller 500 assigns the elected candidate data shard as the leader of the cluster of data shards.

Alternatively, if at block 604 the controller 500 determines that the computing node is storing another data shard assigned as the leader of its respective cluster, the method continues to block 606 where the controller 500 designates the elected candidate data shard as a non-electable follower for its cluster, thereby ensuring that the data shard will not be re-elected as the leader of its cluster. The method then returns to block 602 where the controller 500 elects another candidate data shard to be the leader of the cluster.

As one of ordinary skill in the art will readily recognize, the examples and technologies provided above are simply for clarity and explanation purposes, and can include many additional concepts and variations.

For clarity of explanation, in some instances the present technology may be presented as including individual functional blocks including functional blocks comprising devices, device components, steps or routines in a method embodied in software, or combinations of hardware and software.

In some embodiments the computer-readable storage devices, mediums, and memories can include a cable or wireless signal containing a bit stream and the like. However, when mentioned, non-transitory computer-readable storage media expressly exclude media such as energy, carrier signals, electromagnetic waves, and signals per se.

Methods according to the above-described examples can be implemented using computer-executable instructions that are stored or otherwise available from computer readable media. Such instructions can comprise, for example, instructions and data which cause or otherwise configure a general purpose computer, special purpose computer, or special purpose processing device to perform a certain function or group of functions. Portions of computer resources used can be accessible over a network. The computer executable instructions may be, for example, binaries, intermediate format instructions such as assembly language, firmware, or source code. Examples of computer-readable media that may be used to store instructions, information used, and/or information created during methods according to described examples include magnetic or optical disks, flash memory, USB devices provided with non-volatile memory, networked storage devices, and so on.

Devices implementing methods according to these disclosures can comprise hardware, firmware and/or software, and can take any of a variety of form factors. Typical examples of such form factors include laptops, smart phones, small form factor personal computers, personal digital assistants, rackmount devices, standalone devices, and so on. Functionality described herein also can be embodied in peripherals or add-in cards. Such functionality can also be implemented on a circuit board among different chips or different processes executing in a single device, by way of further example.

The instructions, media for conveying such instructions, computing resources for executing them, and other structures for supporting such computing resources are means for providing the functions described in these disclosures.

Although a variety of examples and other information was used to explain aspects within the scope of the appended claims, no limitation of the claims should be implied based on particular features or arrangements in such examples, as one of ordinary skill would be able to use these examples to derive a wide variety of implementations. Further and although some subject matter may have been described in language specific to examples of structural features and/or method steps, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to these described features or acts. For example, such functionality can be distributed differently or performed in components other than those identified herein. Rather, the described features and steps are disclosed as examples of components of systems and methods within the scope of the appended claims. Moreover, claim language reciting “at least one of” a set indicates that one member of the set or multiple members of the set satisfy the claim.

For clarity of explanation, in some instances the present technology may be presented as including individual functional blocks including functional blocks comprising devices, device components, steps or routines in a method embodied in software, or combinations of hardware and software.

Note that in certain example implementations, the optimization and/or placement functions outlined herein may be implemented by logic encoded in one or more tangible, non-transitory media (e.g., embedded logic provided in an application specific integrated circuit [ASIC], digital signal processor [DSP] instructions, software [potentially inclusive of object code and source code] to be executed by a processor, or other similar machine, etc.). The computer-readable storage devices, mediums, and memories can include a cable or wireless signal containing a bit stream and the like. However, when mentioned, non-transitory computer-readable storage media expressly exclude media such as energy, carrier signals, electromagnetic waves, and signals per se.

Methods according to the above-described examples can be implemented using computer-executable instructions that are stored or otherwise available from computer readable media. Such instructions can comprise, for example, instructions and data which cause or otherwise configure a general purpose computer, special purpose computer, or special purpose processing device to perform a certain function or group of functions. Portions of computer resources used can be accessible over a network. The computer executable instructions may be, for example, binaries, intermediate format instructions such as assembly language, firmware, or source code. Examples of computer-readable media that may be used to store instructions, information used, and/or information created during methods according to described examples include magnetic or optical disks, flash memory, USB devices provided with non-volatile memory, networked storage devices, and so on.

Devices implementing methods according to these disclosures can comprise hardware, firmware and/or software, and can take any of a variety of form factors. Typical examples of such form factors include laptops, smart phones, small form factor personal computers, personal digital assistants, and so on. Functionality described herein also can be embodied in peripherals or add-in cards. Such functionality can also be implemented on a circuit board among different chips or different processes executing in a single device, by way of further example.

The instructions, media for conveying such instructions, computing resources for executing them, and other structures for supporting such computing resources are means for providing the functions described in these disclosures.

Although a variety of examples and other information was used to explain aspects within the scope of the appended claims, no limitation of the claims should be implied based on particular features or arrangements in such examples, as one of ordinary skill would be able to use these examples to derive a wide variety of implementations. Further and although some subject matter may have been described in language specific to examples of structural features and/or method steps, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to these described features or acts. For example, such functionality can be distributed differently or performed in components other than those identified herein. Rather, the described features and steps are disclosed as examples of components of systems and methods within the scope of the appended claims. 

What is claimed is:
 1. A method comprising: prior to assigning a first data shard included in a first cluster of data shards as a leader of the first cluster of data shards, determining whether a first computing node storing the first data shard also stores a second data shard designated as a leader of a second cluster of data shards, yielding a determination; and when the determination indicates that the first computing node stores the second data shard designated as the leader of the second cluster of data shards, designating the first data shard as non-electable to be the leader of the first cluster of data shards and electing an alternate data shard included in the first cluster of data shards as the leader of the first cluster of data shards.
 2. The method of claim 1, further comprising: when the determination indicates that the first computing node does not store the second data shard designated as the leader of the second cluster of data shards, assigning the first data shard as the leader of the first cluster of data shards.
 3. The method of claim 1, wherein the leader of the first cluster of data shards orchestrates replication of data amongst the first cluster of data shards and the leader of the second cluster of data shards orchestrates replication of data amongst the second cluster of data shards.
 4. The method of claim 1, further comprising: prior to determining whether the first computing nodes stores the second data shared designated as the leader of the second cluster of data shards, electing the first data shard as the leader of the first cluster of data shards.
 5. The method of claim 4, further comprising: prior to electing the first data shard as the leader of the first cluster of data shards, determining that the first data shard is designated as eligible to be the leader of the first cluster of data shards.
 6. The method of claim 1, further comprising: while the first data shard is designated as non-electable to be the leader of the first cluster of data shards, determining whether a resource weightage for the first computing node meets or exceeds a threshold resource weightage, yielding a second determination; and when the second determination indicates that the resource weightage for the first computing node does not meet or exceed the threshold resource weightage, designating the first data shard as electable to be the leader of the first cluster.
 7. The method of claim 1, further comprising: after electing the alternate data shard as the leader of the first cluster of data shards, determining whether a second computing node storing the alternate data shard includes a third data shard designated as a leader of a third cluster of data shards, yielding a second determination; and upon a determination that the second computing node does not include the third data shard designated as the leader of the third cluster of data shards, assigning the alternate data shard as the leader of the first cluster of data shards.
 8. A controller comprising: one or more computer processors; and a memory storing instructions that, when executed by the one or more computer processors, cause the controller to: prior to assigning a first data shard included in a first cluster of data shards as a leader of the first cluster of data shards, determine whether a first computing node storing the first data shard also stores a second data shard designated as a leader of a second cluster of data shards, yielding a determination; and when the determination indicates that the first computing node stores the second data shard designated as the leader of the second cluster of data shards, designate the first data shard as non-electable to be the leader of the first cluster of data shards and elect an alternate data shard included in the first cluster of data shards as the leader of the first cluster of data shards.
 9. The controller of claim 8, wherein the instructions further cause the controller to: when the determination indicates that the first computing node does not store the second data shard designated as the leader of the second cluster of data shards, assign the first data shard as the leader of the first cluster of data shards.
 10. The controller of claim 8, wherein the leader of the first cluster of data shards orchestrates replication of data amongst the first cluster of data shards and the leader of the second cluster of data shards orchestrates replication of data amongst the second cluster of data shards.
 11. The controller of claim 8, wherein the instructions further cause the controller to: prior to determining whether the first computing nodes stores the second data shared designated as the leader of the second cluster of data shards, elect the first data shard as the leader of the first cluster of data shards.
 12. The controller of claim 11, wherein the instructions further cause the controller to: prior to electing the first data shard as the leader of the first cluster of data shards, determine that the first data shard is designated as eligible to be the leader of the first cluster of data shards.
 13. The controller of claim 8, wherein the instructions further cause the controller to: while the first data shard is designated as non-electable to be the leader of the first cluster of data shards, determine whether a resource weightage for the first computing node meets or exceeds a threshold resource weightage, yielding a second determination; and when the second determination indicates that the resource weightage for the first computing node does not meet or exceed the threshold resource weightage, designate the first data shard as electable to be the leader of the first cluster.
 14. The controller of claim 8, wherein the instructions further cause the controller to: after electing the alternate data shard as the leader of the first cluster of data shards, determine whether a second computing node storing the alternate data shard includes a third data shard designated as a leader of a third cluster of data shards, yielding a second determination; and upon a determination that the second computing node does not include the third data shard designated as the leader of the third cluster of data shards, assign the alternate data shard as the leader of the first cluster of data shards.
 15. A non-transitory computer-readable medium storing instructions that, when executed by one or more computer processors of a controller, cause the controller to: prior to assigning a first data shard included in a first cluster of data shards as a leader of the first cluster of data shards, determine whether a first computing node storing the first data shard also stores a second data shard designated as a leader of a second cluster of data shards, yielding a determination; and when the determination indicates that the first computing node stores the second data shard designated as the leader of the second cluster of data shards, designate the first data shard as non-electable to be the leader of the first cluster of data shards and elect an alternate data shard included in the first cluster of data shards as the leader of the first cluster of data shards.
 16. The non-transitory computer-readable of claim 15, wherein the instructions further cause the controller to: when the determination indicates that the first computing node does not store the second data shard designated as the leader of the second cluster of data shards, assign the first data shard as the leader of the first cluster of data shards.
 17. The non-transitory computer-readable of claim 15, wherein the leader of the first cluster of data shards orchestrates replication of data amongst the first cluster of data shards and the leader of the second cluster of data shards orchestrates replication of data amongst the second cluster of data shards.
 18. The non-transitory computer-readable of claim 15, wherein the instructions further cause the controller to: prior to determining whether the first computing nodes stores the second data shared designated as the leader of the second cluster of data shards, elect the first data shard as the leader of the first cluster of data shards; and prior to electing the first data shard as the leader of the first cluster of data shards, determine that the first data shard is designated as eligible to be the leader of the first cluster of data shards.
 19. The non-transitory computer-readable of claim 15, wherein the instructions further cause the controller to: while the first data shard is designated as non-electable to be the leader of the first cluster of data shards, determine whether a resource weightage for the first computing node meets or exceeds a threshold resource weightage, yielding a second determination; and when the second determination indicates that the resource weightage for the first computing node does not meet or exceed the threshold resource weightage, designate the first data shard as electable to be the leader of the first cluster.
 20. The non-transitory computer-readable of claim 15, wherein the instructions further cause the controller to: after electing the alternate data shard as the leader of the first cluster of data shards, determine whether a second computing node storing the alternate data shard includes a third data shard designated as a leader of a third cluster of data shards, yielding a second determination; and upon a determination that the second computing node does not include the third data shard designated as the leader of the third cluster of data shards, assign the alternate data shard as the leader of the first cluster of data shards. 